<?php

namespace app\admin\service;

use app\admin\dao\LawCaseDao;
use app\admin\model\UM as UM;
use app\common\model\LawCase;
use app\common\model\Trade;
use ShidianUtil\Utils\TimeUtil;

/**
 * Class LawCaseStatisticsService
 * @package app\admin\service
 */
class LawCaseStatisticsService
{
    // dao
    private LawCaseDao $lawCaseDao;

    public function __construct(LawCaseDao $lawCaseDao)
    {
        $this->lawCaseDao = $lawCaseDao;
    }

    /**
     * 查询
     * @return array
     */
    public function read(?UM $user, $isPublish, $categoryId, $provinceId, $cityId, $startTime, $endTime, $kw): array
    {
        if(is_numeric($endTime)){
            $endTime = TimeUtil::stamp(TimeUtil::DAY, $endTime, false);
        }
        return $this->lawCaseDao->statisticsListLawCases($isPublish, $categoryId, $provinceId, $cityId, $startTime, $endTime, $kw);
    }


}
